import com.beans.BeanScopesController;
import com.beans.BeanScopesController2;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-11-18
 * Time: 15:44
 */
public class App4 {
    public static void main(String[] args) {
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");
        BeanScopesController beanScopesController = context.getBean(BeanScopesController.class);
        System.out.println("A 对象 修改之前的 Name:" + beanScopesController.getUser1().getName());

        BeanScopesController2 beanScopesController2 = context.getBean(BeanScopesController2.class);
        System.out.println("B 对象 获取 Name:" + beanScopesController2.getUser1().getName());
    }
}
